package app.tvprogram;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.beans.PropertyVetoException;

import javax.swing.JDesktopPane;
import javax.swing.JFrame;
import javax.swing.JInternalFrame;
import javax.swing.JLayeredPane;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;

public class TvProgramClientFrame extends JFrame {
    private JDesktopPane jDesktopPane1;
    private JInternalFrame jInternalFrame1;
    private JTabbedPane jTabbedPane1;
    private JPanel jPanel1;

    public TvProgramClientFrame() {
        super();
        this.initialize();
    }

    private void initialize() {
        this.addWindowListener(new WindowAdapter() {

            @Override
            public void windowClosing(WindowEvent ew) {
                System.out.println("windowClosing..., System.exit(0)");
                System.exit(0);
            }

        });
        this.jDesktopPane1 = new JDesktopPane();
        this.getContentPane().add(this.jDesktopPane1, BorderLayout.CENTER);
        this.jDesktopPane1.setBackground(new java.awt.Color(128, 128, 255));
        this.setSize(new Dimension(1024, 768));
        this.jInternalFrame1 = new JInternalFrame();
        this.jDesktopPane1
                .add(this.jInternalFrame1, JLayeredPane.DEFAULT_LAYER);
        this.jInternalFrame1.setBounds(-7, 0, 1016, 734);
        this.jInternalFrame1.setVisible(true);
        try {
            this.jInternalFrame1.setMaximum(true);
        } catch (PropertyVetoException e) {
            e.printStackTrace();
        }
        this.jTabbedPane1 = new JTabbedPane();
        this.jInternalFrame1.getContentPane().add(this.jTabbedPane1,
                BorderLayout.CENTER);
        this.jPanel1 = new TvProgramListPanel();
        this.jTabbedPane1.addTab(Constants.label_tvProgramSchedule, null,
                this.jPanel1, null);
    }

    public static void main(String[] args) {
        System.out.println("TvProgramClientFrame start...");
        TvProgramManager.getInstance().initTvProgram(
                TvProgramManager.getInstance().getAvailableTvChannelMap(),
                true, false);
        TvProgramClientFrame gui = new TvProgramClientFrame();
        gui.setVisible(true);
    }
}
